package org.gp.demo.timer.Trigger;

import java.util.Date;

import org.gp.demo.timer.job.SimpleJob;
import org.quartz.CronExpression;
import org.quartz.CronTrigger;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;

public class CronTriggerDemo {
	public static void main(String[] args) {
		try {
//			JobDetail jobDetail = new JobDetail("job_1", "jgroup1",
//					SimpleJob.class);
//			CronTrigger cronTrigget = new CronTrigger("trgget_1", "tgroup1");
//			CronExpression cexp = new CronExpression("0/5 * * * * ?");
//			cronTrigget.setStartTime(new Date());
//			cronTrigget.setCronExpression(cexp);
			SchedulerFactory schedulerFactory = new StdSchedulerFactory();

			Scheduler scheduler = schedulerFactory.getScheduler();
//			scheduler.scheduleJob(jobDetail, cronTrigget);
			scheduler.start();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
}
